function esconderLinhasTabelaPorCampo() {
	for (var i = 0; i < arguments.length; i++) {
		arguments[i].closest("tr").hide();
	}
	
	return arguments;
}

function esconderLinhasTabelaPorSeletor() {
	for (var i = 0; i < arguments.length; i++) {
		$jq(arguments[i]).closest("tr").hide();
	}
	
	return arguments;
}

function interromperFuncionamentoTeclas() {
	$jq(document).keydown(function(evt) {
		evt.stopPropagation();
		evt.preventDefault();
	});
}

function desabilitarCampos() {
	for (var i = 0; i < arguments.length; i++) {
		arguments[i].attr("disabled", "disabled");
	}
	
	return arguments;
}

function habilitarCampos(componente) {
	for (var i = 0; i < arguments.length; i++) {
		arguments[i].removeAttr("disabled");
	}
	
	return arguments;
}

function limparCampos() {
	for (var i = 0; i < arguments.length; i++) {
		arguments[i].val("");
	}
	
	return arguments;
}

function esconderLinhasTabelaRelatoPorCampo() {
	for (var i = 0; i < arguments.length; i++) {
		arguments[i].closest("tr").hide();
	}
	
	return arguments;
}

function converterDataParaTimestamp(data) {
	
	var curr_year = data.getFullYear();

    var curr_month = data.getMonth() + 1; //Months are zero based
    if (curr_month < 10)
        curr_month = "0" + curr_month;

    var curr_date = data.getDate();
    if (curr_date < 10)
        curr_date = "0" + curr_date;

    var curr_hour = data.getHours();
    if (curr_hour < 10)
        curr_hour = "0" + curr_hour;

    var curr_min = data.getMinutes();
    if (curr_min < 10)
        curr_min = "0" + curr_min;

    var curr_sec = data.getSeconds();     
    if (curr_sec < 10)
        curr_sec = "0" + curr_sec;
    
    return curr_year + "-" + curr_month + "-" + curr_date + " " + curr_hour + ":" + curr_min + ":" + curr_sec;
}


